﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    public class CacheSeatTaiNo
    {
        private List<SeatMonitor> _list;

        public List<SeatMonitor> SeatMonitorList
        {
            get
            {
                return _list;
            }
        }

        public CacheSeatTaiNo(List<SeatMonitor> list)
        {
            _list = list;
        }

        public Guid GetSeatID(string tailNo)
        {
            // return Guid.NewGuid();

            List<SeatMonitor> list = _list.Where(f => f.TailNo == tailNo).ToList();

            if (list.Count != 1)
            {
                throw new Exception("同一飞机不只能被一个席位监管");
            }
            else
            {
                return list[0].SeatID;
            }
        }
    }
}
